<template>
  <div>
    <el-table v-loading="loading" :data="list">
      <el-table-column label="订单号" align="center">
        <template slot-scope="scope">{{
          scope.row.dataPoolPrizeThird.orderNo
        }}</template>
      </el-table-column>
      <el-table-column label="权益领取手机号" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.rightsInterestsGetPhone }}
        </template>
      </el-table-column>
      <el-table-column label="权益名称" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.prizeName }}
        </template>
      </el-table-column>
      <el-table-column label="权益面值" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.prizeFace }}
        </template>
      </el-table-column>
      <el-table-column label="权益批次号" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.couponBatchNumber }}
        </template>
      </el-table-column>
      <el-table-column label="卡券号" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.couponCode }}
        </template>
      </el-table-column>
      <el-table-column label="卡券类型" align="center">
        <template slot-scope="scope">
          <el-tag
            type="success"
            v-if="scope.row.dataPoolPrizeThird.couponType == 1"
            >卡号卡密</el-tag
          >
          <el-tag
            type="success"
            v-if="scope.row.dataPoolPrizeThird.couponType == 2"
            >三方接口</el-tag
          >
          <el-tag
            type="success"
            v-if="scope.row.dataPoolPrizeThird.couponType == 3"
            >实物</el-tag
          >
        </template>
      </el-table-column>
      <el-table-column label="三方卡号" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.thirdCardNumber }}
        </template>
      </el-table-column>
      <el-table-column label="三方卡密" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.thirdCardPassword }}
        </template>
      </el-table-column>
      <el-table-column label="收货人姓名" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.consigneeName }}
        </template>
      </el-table-column>
      <el-table-column label="收货人手机号" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.consigneePhone }}
        </template>
      </el-table-column>
      <el-table-column label="收货地址" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.consigneeAddress }}
        </template>
      </el-table-column>
      <el-table-column label="发货时间" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.sendTime }}
        </template>
      </el-table-column>
      <el-table-column label="物流公司" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.logisticsCompany }}
        </template>
      </el-table-column>
      <el-table-column label="物流单号" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolPrizeThird.logisticsNumber }}
        </template>
      </el-table-column>
      <el-table-column label="权益唯一标识" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolUser.uniqueIdentify }}
        </template>
      </el-table-column>
      <el-table-column label="核销时间" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolUser.cancelTime }}
        </template>
      </el-table-column>
      <el-table-column label="过期时间" align="center">
        <template slot-scope="scope">
          {{ scope.row.dataPoolUser.expireTime }}
        </template>
      </el-table-column>
      <el-table-column label="核销状态" align="center">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.dataPoolPrizeThird.cancelStatus == 0"
            >未核销</el-tag
          >
          <el-tag
            type="success"
            v-if="scope.row.dataPoolPrizeThird.cancelStatus == 1"
            >已核销
          </el-tag>
          <el-tag
            type="warning"
            v-if="scope.row.dataPoolPrizeThird.cancelStatus == 2"
            >已过期</el-tag
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
<script>
import { searchInfo } from "@/api/operation/operationSearch";
export default {
  name: "PrizeList",
  props: {
    loading: {
      type: Boolean,
      default: false,
    },
    queryParams: {
      type: Object,
      default: () => ({
        pageNum: 1,
        pageSize: 10,
      }),
    },
    total: {
      type: Number,
      default: 0,
    },
    //搜索的条件
    dataPoolDTO: {
      type: Object,
    },
    //订单列表
    list: {
      type: Array,
    },
  },
  methods: {
    /** 查询用户列表 */
    getList() {
      this.$emit("update:loading", true);

      searchInfo({
        dataPoolDTO: {
          ...this.dataPoolDTO,
          ...this.queryParams,
          searchType: 1,
        },
      }).then((response) => {
        this.$emit("update:list", response.rows);
        this.$emit("update:total", response.total);
        this.$emit("update:loading", false);
      });
    },
  },
};
</script>
